﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin_info.aspx.cs" Inherits="WL_Store.Web.subpage.admin_info" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="../css/style.css"/>       
        <link href="../assets/css/codemirror.css" rel="stylesheet"/>
        <link rel="stylesheet" href="../assets/css/ace.min.css" />
        <link rel="stylesheet" href="../font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="../js/jquery-1.9.1.min.js"></script>
		<script src="../assets/layer/layer.js" type="text/javascript" ></script>
        <script src="../assets/laydate/laydate.js" type="text/javascript"></script>  
        <script src="../assets/js/bootstrap.min.js"></script>
		<script src="../assets/js/typeahead-bs2.min.js"></script>           	
		<script src="../assets/js/jquery.dataTables.min.js"></script>
		<script src="../assets/js/jquery.dataTables.bootstrap.js"></script>
                      
<title>个人信息管理</title>

    <script>
        $(function () {
            $('.layui-layer-btn0').click(function () {

            });


        });

    </script>


</head>
<body>
    <form id="form1" runat="server">
       <div class="clearfix">
 <div class="admin_info_style">
   <div class="admin_modify_style" id="Personal">
     <div class="type_title">管理员信息 </div>
       <div class="xinxi">
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">编号： </label>
               <div class="col-sm-9"><span><% =myInfo.number %></span></div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">用户名：  </label>
               <div class="col-sm-9">
                   <span><%=myInfo.name %></span>
               </div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">级别： </label>
               <div class="col-sm-9"><span><% =myInfo.Grade %></span></div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">性别： </label>

               <div class="col-sm-9">
                   <span class="sex"><%=myInfo.sex?"女":"男" %></span>
               </div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">年龄： </label>

               <div class="col-sm-9">
                   <span class="sex"><%=myInfo.age %></span>
               </div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">身份证号： </label>
               <div class="col-sm-9"><span><%=myInfo.idcard %></span></div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">移动电话： </label>
               <div class="col-sm-9">
                   <span><%=myInfo.phone %></span>
               </div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">电子邮箱： </label>
               <div class="col-sm-9">
                   <span><%=myInfo.email %></span>
               </div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">地址： </label>
               <div class="col-sm-9">
                   <span><%=myInfo.address %></span>
               </div>
           </div>

           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">入职时间： </label>
               <div class="col-sm-9"><span><%=myInfo.entrytime %></span></div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">注册时间： </label>
               <div class="col-sm-9"><span><%=myInfo.regtime %></span></div>
           </div>
           <div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">登录名： </label>

               <div class="col-sm-9">
                   <span class="sex"><%=myInfo.loginName%></span>
               </div>
           </div>
           <%--<div class="form-group">
               <label class="col-sm-3 control-label no-padding-right" for="form-field-1">登录密码： </label>

               <div class="col-sm-9">
                   <span class="sex"><%=myInfo.loginPassword %></span>
               </div>
           </div>--%>
           <div class="Button_operation clearfix">
               <a id="modification" onclick="change_Password()" class="btn btn-danger radius">修改密码</a>
           </div>
       </div>
   </div>
    <div class="recording_style">
    <div class="type_title">管理员登录记录 </div>
    <div class="recording_list">
     <table class="table table-border table-bordered table-bg table-hover table-sort" id="sample-table">
    <thead>
      <tr class="text-c">
        <th><label><input type="checkbox" class="ace"/><span class="lbl"></span></label></th>
        <th>ID</th>
        <th>登录名</th>
        <th>姓名</th>
        <th>服务器</th>
        <th>客户端IP</th>
        <th>登录时间</th>
        <th>退出时间</th>
      </tr>
    </thead>
    <tbody>

        <asp:Repeater ID="rpt_Logs" runat="server">
            <ItemTemplate>
                 <tr>
          <td><label><input type="checkbox" class="ace"/><span class="lbl"></span></label></td>
          <td><%# Eval("LogId") %></td>
          <td><%# Eval("LoginName") %></td>
          <td><%# Eval("AdminName") %></td>
          <td><%# Eval("ServerName") %></td>
          <td><%# Eval("ClientIP") %></td>
          <td><%# Eval("LoginTime") %></td>
          <td><%# Eval("ExitTimeString") %></td>
      </tr>
            </ItemTemplate>
        </asp:Repeater>
     
       
    </tbody>
  </table>
    </div>
    </div>
 </div>
</div>
 <!--修改密码样式-->
        <div class="change_Pass_style" id="change_Pass">
            <ul class="xg_style">
                <li>
                    <label class="label_name">原&nbsp;&nbsp;密&nbsp;码:</label>
                    <asp:TextBox ID="password" runat="server" type="password"></asp:TextBox>
                </li>
                <li>
                    <label class="label_name">新&nbsp;&nbsp;密&nbsp;码:</label>
                    <asp:TextBox ID="Nes_pas" runat="server" type="password"></asp:TextBox>
                </li>
                <li>
                    <label class="label_name">确认密码:</label>
                    <asp:TextBox ID="c_mew_pas" runat="server" type="password"></asp:TextBox>
                </li>
                
            </ul>
        </div>
       
         
    </form>
</body>
</html>
<script>

 //按钮点击事件
function modify(){
	 $('.text_info').attr("disabled", false);
	 $('.text_info').addClass("add");
	  $('#Personal').find('.xinxi').addClass("hover");
	  $('#Personal').find('.btn-success').css({'display':'block'});
	};
function save_info(){
	    var num=0;
		 var str="";
     $(".xinxi input[type$='text']").each(function(n){
          if($(this).val()=="")
          {
               
			   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
                title: '提示框',				
				icon:0,								
          }); 
		    num++;
            return false;            
          } 
		 });
		  if(num>0){  return false;}	 	
          else{
			  
			   layer.alert('修改成功！',{
               title: '提示框',				
			   icon:1,			   		
			  });
			  $('#Personal').find('.xinxi').removeClass("hover");
			  $('#Personal').find('.text_info').removeClass("add").attr("disabled", true);
			  $('#Personal').find('.btn-success').css({'display':'none'});
			   layer.close(index);
			
		  }		  		
	};	
 //初始化宽度、高度    
    $(".admin_modify_style").height($(window).height()); 
	$(".recording_style").width($(window).width()-400); 
    //当文档窗口发生改变时 触发  
    $(window).resize(function(){
	$(".admin_modify_style").height($(window).height()); 
	$(".recording_style").width($(window).width()-400); 
  });
  //修改密码
  function change_Password(){
	   layer.open({
    type: 1,
	title:'修改密码',
	area: ['300px','300px'],
	shadeClose: true,
	content: $('#change_Pass'),
	btn:['确认修改'],
	yes:function(index, layero){		
		   if ($("#password").val()==""){
			  layer.alert('原密码不能为空!',{
              title: '提示框',				
				icon:0,
			    
			 });
			return false;
          } 
		  if ($("#Nes_pas").val()==""){
			  layer.alert('新密码不能为空!',{
              title: '提示框',				
				icon:0,
			    
			 });
			return false;
          } 
		   
		  if ($("#c_mew_pas").val()==""){
			  layer.alert('确认新密码不能为空!',{
              title: '提示框',				
				icon:0,
			    
			 });
			return false;
          }
		    if(!$("#c_mew_pas").val || $("#c_mew_pas").val() != $("#Nes_pas").val() )
        {
            layer.alert('密码不一致!',{
              title: '提示框',				
				icon:0,
			    
			 });
			 return false;
        }   
		 else{			  
			  layer.alert('修改成功！',{
               title: '提示框',				
			icon:1,		
			  }); 
			  layer.close(index);      
		  }	 
	}
       });
      
    }
    //修改信息
    function change_Info() {
        layer.open({
            type: 1,
            title: '修改信息',
            area: ['300px', '300px'],
            shadeClose: true,
            content: $('#change_Info'),
            btn: ['确认修改'],
            yes: function (index, layero) {
                if ($("#txt_phone").val() == "") {
                    layer.alert('原密码不能为空!', {
                        title: '提示框',
                        icon: 0,

                    });
                    return false;
                }
                if ($("#txt_email").val() == "") {
                    layer.alert('新密码不能为空!', {
                        title: '提示框',
                        icon: 0,

                    });
                    return false;
                }

                if ($("#txt_adds").val() == "") {
                    layer.alert('确认新密码不能为空!', {
                        title: '提示框',
                        icon: 0,

                    });
                    return false;
                }
               
                else {
                    layer.alert('修改成功！', {
                        title: '提示框',
                        icon: 1,
                    });
                    layer.close(index);
                }
            }
        });

    }
</script>
<script>
jQuery(function($) {
		var oTable1 = $('#sample-table').dataTable( {
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,3,4,5,6]}// 制定列不参与排序
		] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
});</script>
